<div class="row justify-content-center">
  <div class="col-md-6">

    <%= render "breadcrumb" %>

    <div class="card border-docker mb-5">
      <%= content_tag :div, class: "card-header" do %>
        <%= image_tag "icons/repo.png", size: "75x75", align: "right" %>

        <span class="text-muted small">Namespace</span>
        <h5 class="card-title mb-1"><%= @repository.namespace.presence || "/" %></h5>

        <span class="text-muted small">Image</span>
        <h5 class="card-title mb-0"><%= @repository.image %></h5>

        <%= render "sort_links" %>
      <% end %>

      <% if @tags.any? %>
        <div class="list-group list-group-flush">
          <% @tags.each do |tag| %>
            <% if Rails.configuration.x.public_registry_url %>
              <div class="copy-to-clipboard-icon">
                <%= render partial: "shared/copy_to_clipboard", locals: { name: :pull_cmd, value: pull_command(@repository.name, tag), style: "icon" } %>
              </div>
            <% end %>

            <%= link_to tag_path(repo: @repository.name, tag: tag), class: "list-group-item list-group-item-action d-flex justify-content-between align-items-center" do %>
              <div class="flex-grow-1">
                <% css_margin = Rails.configuration.x.public_registry_url ? "ml-4" : nil %>
                <%= content_tag :span, "Tag", class: "badge badge-dtag text-uppercase mr-1 #{css_margin}" %>
                <span class="text-monospace small"><%= tag %></span>
              </div>
              <%= image_tag "icons/arrow.png", size: "16x16" %>
            <% end %>
          <% end %>
        </div>
      <% else %>
        <%= render "blank_tags" %>
      <% end %>
    </div>

  </div>
</div>
